<?php

	class PlatformBase {
		static private $instance;

		static function get_instance(){/*{{{*/
			if (!self::$instance){
				self::$instance = self::init();
			}

			return self::$instance;
		}/*}}}*/

		static private function init(){/*{{{*/
			if(!($platform = SystemProperties::$platform)){
				throw new Exception("Platform is empty");
			}

			$filename = "platform_{$platform}.inc";
			if (!include($filename)){
				throw new Exception("Can't include file: $filename");
			}

			$classname = 'Platform'.ucwords($platform);
			if (!($obj = new $classname())){
				throw new Exception("Can't init class: $classname");
			}

			return $obj;
		}/*}}}*/


		function index_prepare(){
		}
	}
